package com.wiscamp.ninechapters.tags.application.assemblers;


import com.wiscamp.ninechapters.tags.application.dto.command.CreateEntityCommand;
import com.wiscamp.ninechapters.tags.application.dto.command.UpdateEntityCommand;
import com.wiscamp.ninechapters.tags.application.dto.vo.EntityVO;
import com.wiscamp.ninechapters.tags.domain.models.Entity;
import jakarta.validation.constraints.NotNull;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EntityAssembler {

    EntityAssembler Instance = Mappers.getMapper(EntityAssembler.class);

    EntityVO toEntityVO(@NotNull Entity entity);

    Entity fromCreateCommand(@NotNull CreateEntityCommand command);

    Entity fromUpdateCommand(@NotNull UpdateEntityCommand command);
}
